<%@ page language="java" import="java.util.*,java.sql.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String id=(String)request.getParameter("id");
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    <style type="text/css"> 
<!-- 
a:link { 
font-size: 14px; 
color: #000000; 
text-decoration: none; 
} 
a:visited { 
font-size: 14px; 
color: #000000; 
text-decoration: none; 
} 
a:hover { 
font-size: 14px; 
color: #999999; 
text-decoration: underline; 
} 
--> 
</style>
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body>
  <% 
  Class.forName("com.mysql.jdbc.Driver").newInstance(); 
String url="jdbc:mysql://localhost:3306/graduatedesign";  
String user="root";  
String password="root"; 
String title="";
String content="";
Connection conn = DriverManager.getConnection(url, user, password); 
Statement sm=conn.createStatement();
ResultSet rs=sm.executeQuery("select title,content from notices where id="+id);
%>
<%
while(rs.next()){
%>
    <form  name="f1" method="post" action="noticeedit?id=<%=id %>" onsubmit="return ck()">
						<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#BBD3EB">
                          	<tr>
                            	<td height="27" align="center" background="/OA/admin/images/index1_72.gif" bgcolor="#FFFFFF">标题</td>
                            	<td bgcolor="#FFFFFF">&nbsp;&nbsp;&nbsp;<input type="text" id="title" name="title" size="50" value="<%=rs.getString(1) %>"/></td>
    						</tr>
                         	<tr>
                            	<td height="27" align="center" background="/OA/admin/images/index1_72.gif" bgcolor="#FFFFFF">内容</td>
                            	<td bgcolor="#FFFFFF">&nbsp;&nbsp;&nbsp;<textarea rows="" cols="" name="content" id="content"><%=rs.getString(2) %></textarea>
									<script  language=javascript src="/OA/fckeditor/fckeditor.js"></script>
								</td>
    						</tr>
    						<tr>
    							<td height="27" align="center" background="/OA/admin/images/index1_72.gif" bgcolor="#FFFFFF"></td>
    							<td bgcolor="#FFFFFF">&nbsp;&nbsp;&nbsp;<input type="submit" value="提交"/><input type="reset" value="重置"/></td>
    						</tr>
    						<script language="javascript">
                              function ck(){
                            	if(f1.title.value==""){
                            		alert("标题不能为空");
                            		return false;
                            	}
                            	alert("操作成功");
                            }
                            </script>
 </table>      
</form> 
<%} %>
  </body>
</html>
